import React, { useState } from 'react'
import { DatePicker, Button } from 'antd'
import style from '../othercompon.module.css';
const { RangePicker } = DatePicker;
export default function SeachLogin(props) {
  const [keyValue, setkeyValue] = useState('')
  const [rilibtn, setrilibtn] = useState([])

  // onChange事件
  function onChange(data, datastring) {
    console.log(datastring)
    setrilibtn(datastring)
  }
  // 搜索点击事件，获取到日历事件并向后端返回
  const onWorkSearchClick = () => {
    console.log(rilibtn)
  }
  // 清除点击事件，
  const resetDate = () => {
    setkeyValue(new Date())
  }
  return (
    <div>
      <RangePicker key={keyValue} onChange={onChange} />
      <Button type="primary" onClick={onWorkSearchClick} className={style.seachBtn}>
        查询
      </Button>
      <Button type="default" onClick={resetDate} className={style.seachBtn}>
        重置
      </Button>
    </div>

  )
}
